<?php
// 创建连接
$conn = mysql_connect("localhost:3306","root","wohenpi0918");
mysql_set_charset('utf8',$conn);
//编码，避免出现乱码
mysql_select_db("student",$conn);
//连接数据库
$id=$_GET['id'];
echo $id;

// 检测连接
if (!$conn) {
    die("Connection failed: " . mysql_connect_error());
}
$sql="DELETE FROM rent WHERE id={$id}";


if (mysql_query($sql,$conn)) {
    echo "删除成功";
    
echo "<script> window.location.href='manger.php';</script>";
} else {
    echo "Error: " . $sql . "<br>" . mysql_error($conn);
}


?>